$(function () {
    $.messager.model = {
        ok:{text:"确认",classed:"btn-success"},
        cancel:{text:"取消",classed:'btn-default'}
    }

    $('.btn-delete').click(function () {
        var url = $(this).data('url');
        $.messager.confirm("温馨提示","您确定要删除吗?",function () {
            $.post(url,function (data) {
                if(data.success){
                    $.messager.confirm("温馨提示",data.msg,function () {
                        console.log(data.msg);
                        window.location.reload();
                    });
                }else {
                    $.messager.alert("温馨提示",data.msg);
                }
            })
        })
    })

})